package source.model;

/**
 * Represents the Health of an Entity
 * @author Tristan
 *
 */
public class Health {
	private int maxHealth;
	private int currentHealth;
	
	public Health(int health){
		maxHealth = health;
		currentHealth = health;
	}
	
	public int maxHealth() {	return maxHealth;	}
	public int currentHealth(){	return currentHealth;}
	
	/**
	 * @param modHealth: int
	 * Modifies the health values by modHealth. Returns TRUE if the objects health
	 * is above zero, returns FALSE if zero or below.
	 */
	public boolean modHealth(int modHealth){
		currentHealth += modHealth;
		if (currentHealth > maxHealth) currentHealth = maxHealth;
		if (currentHealth <= 0) return false;
		return true;
	}
	
	public void increaseMaxHealth(int amount){
		maxHealth+=amount;
	}
}
